<template>
	<view>
		<dsl-navbar title="实名认证" isBack bgTopImg="white"></dsl-navbar>
		<form @submit="formSubmit">
			<view class="padding">
				<view>真实姓名</view>
				<view class="solid-bottom padding-bottom">
					<input type="text" value="" placeholder="请输入您的姓名" name='name' />
				</view>
			</view>
			<view class="padding">
				<view>身份证号码</view>
				<view class="solid-bottom padding-bottom">
					<input type="text" value="" placeholder="请输入身份证号码" name='idcode' />
				</view>
			</view>
			<view class="padding">
				<view>银行卡号</view>
				<view class="solid-bottom padding-bottom">
					<input type="text" value="" placeholder="请输入银行卡号" name='bankcard' />
				</view>
			</view>
			<view class="padding">
				<view>手机号码</view>
				<view class="solid-bottom padding-bottom">
					<input type="text" value="" placeholder="请输入手机号码" name='tel' />
				</view>
			</view>
			<button class="submit_form" form-type="submit">
				提交
			</button>
		</form>
	</view>
</template>

<script>
	import {
		realname
	} from '@/common/path.js'
	export default {
		data() {
			return {
				date: '', //日期
				userSex: [{
						sex: '男',
					},
					{
						sex: '女',
					}
				],
				sexNum: 0
			}
		},
		onLoad() {},
		methods: {
			//实名认证
			formSubmit(e) {
				let _shw = this.$tools.showToast
				let obj =e.detail.value
				console.log();
				if (obj.name == '') {
					_shw('真实姓名暂未填写')
					return
				}
				if (obj.idcode == '') {
					_shw('身份证号暂未填写')
					return
				}
				if (obj.bankcard == '') {
					_shw('银行卡号暂未填写')
					return
				}
				if (obj.tel == '') {
					_shw('手机号暂未填写')
					return
				}
				
				this.Http.POST(realname, obj)
					.then(res => {
						console.log('[实名资料]',res);
						if (res.code == 1) {
							let _this = this
							uni.showModal({
								title: '温馨提示',
								content: '实名认证已提交',
								success: function(Res) {
									if (Res.confirm) {
										uni.navigateBack()
									} else if (Res.cancel) {
										uni.navigateBack()
									}
								}
							})
						} else {
							this.$tools.showToast(res.msg)
						}
					})
			}
		}
	}
</script>

<style>
	.expression {
		width: 46rpx;
		height: 46rpx;
		background: #00D88F;
		border-radius: 50%;
		opacity: 1;
		line-height: 46rpx;
		text-align: center;
		color: white;
	}

	input {
		width: 500rpx;
	}

	.user_sex {
		width: 140rpx;
		height: 50rpx;
		border: 1rpx solid #E6716D;
		opacity: 1;
		background-color: white;
		line-height: 50rpx;
		text-align: center;
		color: #E6716D;
		border-radius: 99rpx;
	}

	.sex_active {
		width: 140rpx;
		height: 50rpx;
		background: #E6716D;
		opacity: 1;
		border-radius: 25rpx;
		line-height: 50rpx;
		color: white;
		text-align: center;
	}

	.submit_form {
		width: 482rpx;
		height: 98rpx;
		background: #00D88F;
		box-shadow: 0px 1rpx 10rpx rgba(0, 216, 143, 0.5);
		opacity: 1;
		border-radius: 60rpx;
		line-height: 98rpx;
		text-align: center;
		color: white;
		margin: 0 auto;
	}
</style>
